package com.cloud.spring.demo.controller;

import com.cloud.spring.demo.entity.Address;
import com.cloud.spring.demo.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("address")
public class AddressController {
    @Autowired
    AddressService addressService;

    @GetMapping("insert")
    public int insert() {
        return addressService.insert();
    }

    @GetMapping("findById2")
    public Address findById2(int id) {
        return addressService.findById2(id);
    }
}
